package org.zerta.troops.common;

import java.util.Map;
import java.util.HashMap;



public class World {
	
	private String name;
	private Map<String, Area> areas;
	
	public World () {
		areas = new HashMap<String, Area>();
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Area findArea ( String areaName ) {
		if (areas.containsKey(areaName.toLowerCase())) {
			return areas.get(areaName.toLowerCase());
		} else {
			return null;
		}
	}
	
	public void addArea( Area area ) {
		areas.put(area.getName().toLowerCase(), area);
	}
	
	public Map<String, Area> getAreas() {
		return areas;
	}
	
}
